package com.chensj.ws.client;

import com.chensj.ws.service.IMyService;

import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * @author chensj
 * @title
 * @email chensj@winning.com.cn
 * @package com.chensj.ws.client
 * @date: 2018-12-16 下午7:46
 */
public class TestClient {
    public static void main(String[] args){
        try {
            URL url = new URL("http://localhost:8888/ws?wsdl");
            QName qName = new QName("http://service.ws.chensj.com/","MyServiceImplService");
            Service service = Service.create(url,qName);
            IMyService myService = service.getPort(IMyService.class);
            System.out.println(myService.add(5,6));
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }

}
